]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Use user-defined calendar application for the date menu calendar button
authorTassilo Horn <tassilo@member.fsf.org>
Thu, 11 Aug 2011 09:30:47 +0000 (11:30 +0200)
committerDan Winship <danw@gnome.org>
Fri, 12 Aug 2011 16:50:04 +0000 (12:50 -0400)
Use the existing setting

  org.gnome.desktop.default-applications.office.calendar.exec

as calendar application instead of the hard-coded evolution.  Evolution
is still the fallback if that setting is cleared (it defaults to
evolution).

https://bugzilla.gnome.org/show_bug.cgi?id=651190

js/ui/dateMenu.js

index d288947bddc92e60dfc80551b48c9c69aed2d3ac..a48fde7775e43435cb8f81f1e01f610503d8a48e 100644 (file)
@@ -205,7 +205,24 @@ DateMenuButton.prototype = {
 
     _onOpenCalendarActivate: function() {
         this.menu.close();
-        // TODO: pass the selected day
-        Util.spawn(['evolution', '-c', 'calendar']);
+        let calendarSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.office.calendar' });
+        let tool = calendarSettings.get_string('exec');
+        if (tool.length == 0 || tool == 'evolution') {
+            // TODO: pass the selected day
+            Util.spawn(['evolution', '-c', 'calendar']);
+        } else {
+            let needTerm = calendarSettings.get_boolean('needs-term');
+            if (needTerm) {
+                let terminalSettings = new Gio.Settings({ schema: 'org.gnome.desktop.default-applications.terminal' });
+                let term = terminalSettings.get_string('exec');
+                let arg = terminalSettings.get_string('exec-arg');
+                if (arg != '')
+                    Util.spawn([term, arg, tool]);
+                else
+                    Util.spawn([term, tool]);
+            } else {
+                Util.spawnCommandLine(tool)
+            }
+        }
     }
 };